<template>
  <a-input v-bind="$attrs" @keypress.enter="onSearch">
    <template v-if="showIcon" #suffix>
      <i-icons-search class="cursor-pointer" @click="onSearch" />
    </template>
  </a-input>
</template>

<script setup lang="ts">
import type { CloudFilterBarState } from '../types'

defineProps({
  state: Object as PropType<CloudFilterBarState>,
  showIcon: Boolean
})
const emit = defineEmits(['search'])
const onSearch = () => {
  emit('search')
}
</script>

<style scoped></style>
